﻿using System;
using System.Collections.Generic;
using System.Text;

using ESRI.ArcGIS.ADF.BaseClasses;
using ESRI.ArcGIS.SystemUI;
using ESRI.ArcGIS.Controls;
using ESRI.ArcGIS.Carto;

namespace SZ
{
        public class ClearAllLayers : BaseCommand
        {
            private IMapControl3 m_MapControl;

            public ClearAllLayers()
            {
                base.m_caption = "清空所有图层";
            }

            public override void OnClick()
            {
                m_MapControl.ClearLayers();
                m_MapControl.ActiveView.Refresh();
                //m_TocControl.Update();
                GC.Collect();
            }

            public override void OnCreate(object hook)
            {
                m_MapControl = (IMapControl3)hook;
            }
        }
   
}
